package com.cttic.kafka2kafka;

import com.cttic.kafka2kafka.config.KafkaConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.EmbeddedValueResolverAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringValueResolver;

@SpringBootApplication
@Configuration
public class KKApplication implements EmbeddedValueResolverAware {

    public static void main(String[] args) {
        SpringApplication.run(KKApplication.class,args);
    }

    @Override
    public void setEmbeddedValueResolver(StringValueResolver stringValueResolver) {
        KafkaConfiguration.HADOOP_KAFKA = stringValueResolver.resolveStringValue("${kafka.topic}");
    }
}
